/**
 * 医院等级
 */
import { listOne } from "../type/CommonData";

export const hospitalLevle: listOne[] = [
  { code: "1", name: "三级甲等" },
  { code: "2", name: "三级乙等" },
  { code: "3", name: "二级甲等" },
  { code: "4", name: "二级乙等" },
  { code: "5", name: "一级甲等" },
  { code: "6", name: "一级乙等" }
];
/**
 *  医院类型
 */
export const hospitalType: listOne[] = [
  { code: "1", name: "综合医院" },
  { code: "2", name: "儿科医院" },
  { code: "3", name: "骨科医院" },
  { code: "4", name: "耳喉鼻科医院" },
  { code: "5", name: "美容医院" },
  { code: "6", name: "肿瘤医院" }
];

export const getFilterName = (array: any, param: string | undefined) => {
  if (!param) {
    return "无数据";
  }
  const name: any = hospitalLevle.find((value, index, obj) => {
    if (value.code === param) {
      return true;
    } else {
      return false;
    }
  });
  if (!name) {
    return "无数据";
  }
  return name.name;
};
